com.jproxy.proxy
Class DataStack

java.lang.Object
  |
  +--com.jproxy.proxy.util.ThreadSupport
        |
        +--com.jproxy.proxy.DataStack
All Implemented Interfaces:
java.lang.Runnable

public class DataStack
extends ThreadSupport

The DataStack class accelerates communication between client and Tunnel server. It packages several consiquen client's request in one package. The package then is delivered to Tunnel server. Tunnel server unpack the request and perform them in original sequence. Results from performed sequence are also packaged and returned to client. Not all remote calls may be used for such agregated calls. The Tunneling is aware about calls that it may package. These calls are such as calls that return void or remote object stubs or references. There is one instance of DataStack for each Server URL.

See Also:
com.jproxy.proxy.Client, TunnelInvocationHandler

Field Summary
static boolean isOn
           
 
Constructor Summary
DataStack(Tunnel _tunnel)
          Constructs DataStack object for Tunnel object
 
Method Summary
static void destroy()
          destroys all opened DataStack objects
static DataStack getDataStack(Tunnel tunnel)
          The factory for DataStack instantiation.
 java.lang.Object[] getResult()
          Returns results for performed requests
 void init()
          Initializes the DataStack object.
 boolean isSending()
          returns flag showing if sending of package is in progress
 void push(Marshalable data)
          Pushes next request to stack and checks flags that may force a sending.
 void send()
          Performs sending of package to Tunnel server.
 void start()
          Starts execution of thread that controls sending of package of requests.
 
Methods inherited from class com.jproxy.proxy.util.ThreadSupport
isRunning, isStopping, run, stop
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isOn

public static boolean isOn
Constructor Detail

DataStack

public DataStack(Tunnel _tunnel)
Constructs DataStack object for Tunnel object
Parameters:
tunnel - object of Tunnel class
Method Detail

destroy

public static void destroy()
destroys all opened DataStack objects

getDataStack

public static DataStack getDataStack(Tunnel tunnel)
The factory for DataStack instantiation. Only one DataStack may be created for certain server URL.
Parameters:
serverUrl - URL string of remote host.
tunnel - object

init

public void init()
Initializes the DataStack object.

getResult

public java.lang.Object[] getResult()
Returns results for performed requests

isSending

public boolean isSending()
returns flag showing if sending of package is in progress

push

public void push(Marshalable data)
          throws TunnelException
Pushes next request to stack and checks flags that may force a sending.
Parameters:
reuest - data for performing remote call. The data will be appended to package.

start

public void start()
Starts execution of thread that controls sending of package of requests.
Overrides:
start in class ThreadSupport

send

public void send()
Performs sending of package to Tunnel server.


Copyright ⌐ JProxy LLC. All Rights Reserved.